***Denmark***

use "C:\Users\User\Downloads\joint_data_narratives - with codings - for SPSS (1) (1).dta"
keep if countryID==1
* Three-level voting variable
tab DN_votechoice, sort
gen den_vote = . 
replace den_vote = 1 if DN_votechoice==6
replace den_vote = 2 if DN_votechoice==1 
replace den_vote = 2 if DN_votechoice==2 
replace den_vote = 2 if DN_votechoice==3 
replace den_vote = 2 if DN_votechoice==4 
replace den_vote = 2 if DN_votechoice==5 
replace den_vote = 2 if DN_votechoice==7 
replace den_vote = 2 if DN_votechoice==8 
replace den_vote = 2 if DN_votechoice==9 
replace den_vote = 3 if DN_votechoice==10 
replace den_vote = 3 if DN_votechoice==11 
replace den_vote = 3 if DN_votechoice==12
replace den_vote = 3 if DN_votechoice==99 
label define den_vote1 1 "Populist" 2 "Other Party" 3 "Other Answer"
label values den_vote den_vote1
tab den_vote DN_votechoice
tab den_vote
* Two-level voting variable
gen populist_vote_dn = .
replace populist_vote_dn = 1 if DN_votechoice==6
replace populist_vote_dn = 0 if DN_votechoice!=6
tab populist_vote

* MCA
label define general_past 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 "Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
17 "P.assas" 18 "Sport" , replace
label values general_past general_past

label define general_future 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 " Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
18 "Sport" , replace
label values general_future general_future

label define DN_votechoice 1 "Social Democrats" 2 "Social Liberal" 3 "Conservative" 4 "Socialistic PP" 5 "Liberal Alliance" 6 "PP" 7 "Liberals" 8 "Unity List" 9 "Alternative", replace
label values DN_votechoice DN_votechoice

* Recode some of the independent variables
tab political_discussion
replace political_discussion = . if political_discussion==99
revrs political_discussion
tab revpolitical_discussion
replace leftright = . if leftright==99
tab leftright
alpha newspaper_consumption newsweb_consumption tvnews_consumption
gen general_news_consumption = (newspaper_consumption + newsweb_consumption + tvnews_consumption)/3
tab general_news_consumption
recode DN_education (7=0)
replace DN_education = . if DN_education==6
replace DN_education = . if DN_education==99
tab DN_education
revrs DN_social_class
tab revDN_social_class
replace revDN_social_class=4 if revDN_social_class==5
gen rural = DN_residence
replace rural = 1 if DN_residence==5
replace rural = 0 if DN_residence!=5
tab rural
tab statement8
replace statement8 = . if statement8==99
tab statement8
gen know1 = 1 if DN_polknowledge1==1
replace know1 = 0 if know1==.
gen know2 = 1 if DN_polknowledge2==2
replace know2 = 0 if know2==.
gen political_knowledge = know1+know2

* Coded stories
gen	traditional_past	=	.				
replace	traditional_past	=	0	if	pastEvent_groups	==	"No answer"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW2"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Introduction of the Basic Law"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Getting\losing Southern Jutland"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Joining the EU"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Denmark wins EU football championship 1992"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The introdruction of democracy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"EU referendums"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Many"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The abolition of serfdom"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Having\not having a monarchy"
replace	traditional_past	=	1	if	pastEvent_groups	==	"The reformation"
replace	traditional_past	=	1	if	pastEvent_groups	==	"the Viking age"
replace	traditional_past	=	1	if	pastEvent_groups	==	"The christianazation of Denmark"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The introduction of the welfare state"
replace	traditional_past	=	0	if	pastEvent_groups	==	"First female Prime minister"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Other"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The independence of Denmark"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Denmark becoming a unified kingdom"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Glistrup era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The conquest of England"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When the royal family gave the people the right to vote"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Kalmar Union"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Industrialization"
replace	traditional_past	=	1	if	pastEvent_groups	==	"The viking age"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW1"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War"
replace	traditional_past	=	0	if	pastEvent_groups	==	"World wars"
replace	traditional_past	=	0	if	pastEvent_groups	==	"lossing territory to the germans"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Equality"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Holger Danske era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Rasmussen governtment"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Stauning era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Terror in copenhagen"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The attack on World Trade center"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The loss of Norway"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the battle against sweden"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the battle at Dybb?l"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the battle on f?lleden"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the introduction of free health care"
replace	traditional_past	=	0	if	pastEvent_groups	==	"18-year-vote"
replace	traditional_past	=	0	if	pastEvent_groups	==	"18-year-voting"
replace	traditional_past	=	0	if	pastEvent_groups	==	"1960"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Agriculture reform"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Anker era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Battle of Copenhagen"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Christian IV era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Equal wages"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Hovedaftalen 1899"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Kartoffelkuren 1986"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Knud Lavard's murder"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Labour movement"
replace	traditional_past	=	0	if	pastEvent_groups	==	"NATO nembership"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Napolion war"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Niels Bohr era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Niels Ebbesens murder"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Norway and Sweden secession"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Peace"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Political parties"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Schl?ter era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Struensees power manipulation of king Christian VII"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Attack on Lindisfarne 8-6-793."
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Cuban crisis"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Muhammed drawings"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Tamil Case"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Unions battle against fair wages and working conditions"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The defeat at Leuven year 891."
replace	traditional_past	=	0	if	pastEvent_groups	==	"The discovery of the Golden Horns of Gallehus"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The equality law"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The establishment of the Progress Party"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The establishment of the region orchestra"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The financial crises"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The invention of the wheel"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The old Little Belt bridge"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The present"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The social inequalities"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The social law"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The storm"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When Venstre lost the power"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When the crown prince couple got married"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When the financial crisis was over"
replace	traditional_past	=	0	if	pastEvent_groups	==	"change of political system in 1901"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the Age of Enlightenment"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the Marshall help"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the battle at Hastings, 1066"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the end of the last ice age"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the little mermaid"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the loss of Sk?ne, Halland og Blekinge"
replace	traditional_past	=	0	if	pastEvent_groups	==	"the rebelion i 1967-68"
replace	traditional_past	=	0	if	pastEvent_groups	==	"unemployment"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When we sold the oil to Norway without getting anything in return"
							
							
gen	survival_past	=	.				
replace	survival_past	=	0	if	pastEvent_groups	==	"No answer"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW2"
replace	survival_past	=	0	if	pastEvent_groups	==	"Introduction of the Basic Law"
replace	survival_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	survival_past	=	1	if	pastEvent_groups	==	"Getting\losing Southern Jutland"
replace	survival_past	=	0	if	pastEvent_groups	==	"Joining the EU"
replace	survival_past	=	0	if	pastEvent_groups	==	"Denmark wins EU football championship 1992"
replace	survival_past	=	0	if	pastEvent_groups	==	"The introdruction of democracy"
replace	survival_past	=	0	if	pastEvent_groups	==	"EU referendums"
replace	survival_past	=	0	if	pastEvent_groups	==	"Many"
replace	survival_past	=	0	if	pastEvent_groups	==	"The abolition of serfdom"
replace	survival_past	=	0	if	pastEvent_groups	==	"Having\not having a monarchy"
replace	survival_past	=	0	if	pastEvent_groups	==	"The reformation"
replace	survival_past	=	0	if	pastEvent_groups	==	"the Viking age"
replace	survival_past	=	0	if	pastEvent_groups	==	"The christianazation of Denmark"
replace	survival_past	=	1	if	pastEvent_groups	==	"The introduction of the welfare state"
replace	survival_past	=	0	if	pastEvent_groups	==	"First female Prime minister"
replace	survival_past	=	0	if	pastEvent_groups	==	"Other"
replace	survival_past	=	0	if	pastEvent_groups	==	"The independence of Denmark"
replace	survival_past	=	0	if	pastEvent_groups	==	"Denmark becoming a unified kingdom"
replace	survival_past	=	0	if	pastEvent_groups	==	"Glistrup era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	survival_past	=	1	if	pastEvent_groups	==	"The conquest of England"
replace	survival_past	=	0	if	pastEvent_groups	==	"When the royal family gave the people the right to vote"
replace	survival_past	=	0	if	pastEvent_groups	==	"Kalmar Union"
replace	survival_past	=	1	if	pastEvent_groups	==	"The Industrialization"
replace	survival_past	=	0	if	pastEvent_groups	==	"The viking age"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW1"
replace	survival_past	=	1	if	pastEvent_groups	==	"War"
replace	survival_past	=	1	if	pastEvent_groups	==	"World wars"
replace	survival_past	=	1	if	pastEvent_groups	==	"lossing territory to the germans"
replace	survival_past	=	0	if	pastEvent_groups	==	"Equality"
replace	survival_past	=	0	if	pastEvent_groups	==	"Holger Danske era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Rasmussen governtment"
replace	survival_past	=	0	if	pastEvent_groups	==	"Stauning era"
replace	survival_past	=	1	if	pastEvent_groups	==	"Terror in copenhagen"
replace	survival_past	=	1	if	pastEvent_groups	==	"The attack on World Trade center"
replace	survival_past	=	1	if	pastEvent_groups	==	"The loss of Norway"
replace	survival_past	=	1	if	pastEvent_groups	==	"the battle against sweden"
replace	survival_past	=	1	if	pastEvent_groups	==	"the battle at Dybb?l"
replace	survival_past	=	1	if	pastEvent_groups	==	"the battle on f?lleden"
replace	survival_past	=	0	if	pastEvent_groups	==	"the introduction of free health care"
replace	survival_past	=	0	if	pastEvent_groups	==	"18-year-vote"
replace	survival_past	=	0	if	pastEvent_groups	==	"18-year-voting"
replace	survival_past	=	0	if	pastEvent_groups	==	"1960"
replace	survival_past	=	0	if	pastEvent_groups	==	"Agriculture reform"
replace	survival_past	=	0	if	pastEvent_groups	==	"Anker era"
replace	survival_past	=	1	if	pastEvent_groups	==	"Battle of Copenhagen"
replace	survival_past	=	0	if	pastEvent_groups	==	"Christian IV era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Equal wages"
replace	survival_past	=	0	if	pastEvent_groups	==	"Hovedaftalen 1899"
replace	survival_past	=	0	if	pastEvent_groups	==	"Kartoffelkuren 1986"
replace	survival_past	=	0	if	pastEvent_groups	==	"Knud Lavard's murder"
replace	survival_past	=	0	if	pastEvent_groups	==	"Labour movement"
replace	survival_past	=	0	if	pastEvent_groups	==	"NATO nembership"
replace	survival_past	=	1	if	pastEvent_groups	==	"Napolion war"
replace	survival_past	=	0	if	pastEvent_groups	==	"Niels Bohr era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Niels Ebbesens murder"
replace	survival_past	=	0	if	pastEvent_groups	==	"Norway and Sweden secession"
replace	survival_past	=	0	if	pastEvent_groups	==	"Peace"
replace	survival_past	=	0	if	pastEvent_groups	==	"Political parties"
replace	survival_past	=	0	if	pastEvent_groups	==	"Schl?ter era"
replace	survival_past	=	1	if	pastEvent_groups	==	"Struensees power manipulation of king Christian VII"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Attack on Lindisfarne 8-6-793."
replace	survival_past	=	0	if	pastEvent_groups	==	"The Cuban crisis"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Muhammed drawings"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Tamil Case"
replace	survival_past	=	1	if	pastEvent_groups	==	"The Unions battle against fair wages and working conditions"
replace	survival_past	=	1	if	pastEvent_groups	==	"The defeat at Leuven year 891."
replace	survival_past	=	0	if	pastEvent_groups	==	"The discovery of the Golden Horns of Gallehus"
replace	survival_past	=	0	if	pastEvent_groups	==	"The equality law"
replace	survival_past	=	0	if	pastEvent_groups	==	"The establishment of the Progress Party"
replace	survival_past	=	0	if	pastEvent_groups	==	"The establishment of the region orchestra"
replace	survival_past	=	1	if	pastEvent_groups	==	"The financial crises"
replace	survival_past	=	0	if	pastEvent_groups	==	"The invention of the wheel"
replace	survival_past	=	0	if	pastEvent_groups	==	"The old Little Belt bridge"
replace	survival_past	=	0	if	pastEvent_groups	==	"The present"
replace	survival_past	=	0	if	pastEvent_groups	==	"The social inequalities"
replace	survival_past	=	0	if	pastEvent_groups	==	"The social law"
replace	survival_past	=	0	if	pastEvent_groups	==	"The storm"
replace	survival_past	=	0	if	pastEvent_groups	==	"When Venstre lost the power"
replace	survival_past	=	0	if	pastEvent_groups	==	"When the crown prince couple got married"
replace	survival_past	=	1	if	pastEvent_groups	==	"When the financial crisis was over"
replace	survival_past	=	0	if	pastEvent_groups	==	"change of political system in 1901"
replace	survival_past	=	0	if	pastEvent_groups	==	"the Age of Enlightenment"
replace	survival_past	=	0	if	pastEvent_groups	==	"the Marshall help"
replace	survival_past	=	1	if	pastEvent_groups	==	"the battle at Hastings, 1066"
replace	survival_past	=	0	if	pastEvent_groups	==	"the end of the last ice age"
replace	survival_past	=	0	if	pastEvent_groups	==	"the little mermaid"
replace	survival_past	=	0	if	pastEvent_groups	==	"the loss of Sk?ne, Halland og Blekinge"
replace	survival_past	=	0	if	pastEvent_groups	==	"the rebelion i 1967-68"
replace	survival_past	=	1	if	pastEvent_groups	==	"unemployment"
replace	survival_past	=	0	if	pastEvent_groups	==	"When we sold the oil to Norway without getting anything in return"
							
							
gen	self_expression_past	=	.				
replace	self_expression_past	=	0	if	pastEvent_groups	==	"No answer"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW2"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Introduction of the Basic Law"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Women's rights"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Getting\losing Southern Jutland"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Joining the EU"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Denmark wins EU football championship 1992"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"The introdruction of democracy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"EU referendums"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Many"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"The abolition of serfdom"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Having\not having a monarchy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The reformation"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the Viking age"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The christianazation of Denmark"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The introduction of the welfare state"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"First female Prime minister"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Other"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The independence of Denmark"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Denmark becoming a unified kingdom"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Glistrup era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The conquest of England"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"When the royal family gave the people the right to vote"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Kalmar Union"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Industrialization"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The viking age"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW1"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"World wars"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"lossing territory to the germans"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Equality"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Holger Danske era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Rasmussen governtment"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Stauning era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Terror in copenhagen"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The attack on World Trade center"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The loss of Norway"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the battle against sweden"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the battle at Dybb?l"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the battle on f?lleden"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the introduction of free health care"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"18-year-vote"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"18-year-voting"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"1960"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Agriculture reform"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Anker era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Battle of Copenhagen"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Christian IV era"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Equal wages"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Hovedaftalen 1899"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Kartoffelkuren 1986"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Knud Lavard's murder"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Labour movement"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"NATO nembership"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Napolion war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Niels Bohr era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Niels Ebbesens murder"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Norway and Sweden secession"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Peace"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Political parties"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Schl?ter era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Struensees power manipulation of king Christian VII"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Attack on Lindisfarne 8-6-793."
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Cuban crisis"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Muhammed drawings"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Tamil Case"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Unions battle against fair wages and working conditions"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The defeat at Leuven year 891."
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The discovery of the Golden Horns of Gallehus"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"The equality law"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The establishment of the Progress Party"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The establishment of the region orchestra"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The financial crises"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The invention of the wheel"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The old Little Belt bridge"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The present"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"The social inequalities"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The social law"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The storm"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When Venstre lost the power"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When the crown prince couple got married"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When the financial crisis was over"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"change of political system in 1901"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the Age of Enlightenment"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the Marshall help"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the battle at Hastings, 1066"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the end of the last ice age"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the little mermaid"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the loss of Sk?ne, Halland og Blekinge"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"the rebelion i 1967-68"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"unemployment"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When we sold the oil to Norway without getting anything in return"
							
							
gen	us_vs_them_past	=	.				
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"No answer"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW2"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Introduction of the Basic Law"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Getting\losing Southern Jutland"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Joining the EU"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Denmark wins EU football championship 1992"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The introdruction of democracy"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"EU referendums"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The abolition of serfdom"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Having\not having a monarchy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The reformation"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the Viking age"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The christianazation of Denmark"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The introduction of the welfare state"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"First female Prime minister"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Other"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The independence of Denmark"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Denmark becoming a unified kingdom"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Glistrup era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The conquest of England"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When the royal family gave the people the right to vote"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Kalmar Union"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Industrialization"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The viking age"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW1"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"War"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"World wars"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"lossing territory to the germans"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Equality"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Holger Danske era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Rasmussen governtment"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Stauning era"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Terror in copenhagen"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The attack on World Trade center"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The loss of Norway"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"the battle against sweden"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"the battle at Dybb?l"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"the battle on f?lleden"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the introduction of free health care"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"18-year-vote"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"18-year-voting"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"1960"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Agriculture reform"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Anker era"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Battle of Copenhagen"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Christian IV era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Equal wages"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Hovedaftalen 1899"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Kartoffelkuren 1986"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Knud Lavard's murder"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Labour movement"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"NATO nembership"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Napolion war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Niels Bohr era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Niels Ebbesens murder"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Norway and Sweden secession"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Peace"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Political parties"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Schl?ter era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Struensees power manipulation of king Christian VII"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The Attack on Lindisfarne 8-6-793."
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Cuban crisis"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The Muhammed drawings"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Tamil Case"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Unions battle against fair wages and working conditions"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"The defeat at Leuven year 891."
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The discovery of the Golden Horns of Gallehus"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The equality law"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The establishment of the Progress Party"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The establishment of the region orchestra"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The financial crises"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The invention of the wheel"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The old Little Belt bridge"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The present"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The social inequalities"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The social law"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The storm"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When Venstre lost the power"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When the crown prince couple got married"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When the financial crisis was over"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"change of political system in 1901"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the Age of Enlightenment"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the Marshall help"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the battle at Hastings, 1066"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the end of the last ice age"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the little mermaid"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the loss of Sk?ne, Halland og Blekinge"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"the rebelion i 1967-68"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"unemployment"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When we sold the oil to Norway without getting anything in return"
							
							
gen	us_and_them_past	=	.				
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"No answer"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW2"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Introduction of the Basic Law"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Getting\losing Southern Jutland"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"Joining the EU"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Denmark wins EU football championship 1992"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The introdruction of democracy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"EU referendums"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The abolition of serfdom"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Having\not having a monarchy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The reformation"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the Viking age"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The christianazation of Denmark"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The introduction of the welfare state"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"First female Prime minister"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Other"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The independence of Denmark"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Denmark becoming a unified kingdom"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Glistrup era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The conquest of England"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When the royal family gave the people the right to vote"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Kalmar Union"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Industrialization"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The viking age"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW1"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"World wars"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"lossing territory to the germans"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Equality"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Holger Danske era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Rasmussen governtment"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Stauning era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Terror in copenhagen"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The attack on World Trade center"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The loss of Norway"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the battle against sweden"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the battle at Dybb?l"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the battle on f?lleden"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the introduction of free health care"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"18-year-vote"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"18-year-voting"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"1960"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Agriculture reform"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Anker era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Battle of Copenhagen"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Christian IV era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Equal wages"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Hovedaftalen 1899"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Kartoffelkuren 1986"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Knud Lavard's murder"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Labour movement"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"NATO nembership"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Napolion war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Niels Bohr era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Niels Ebbesens murder"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Norway and Sweden secession"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"Peace"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Political parties"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Schl?ter era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Struensees power manipulation of king Christian VII"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Attack on Lindisfarne 8-6-793."
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Cuban crisis"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Muhammed drawings"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Tamil Case"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Unions battle against fair wages and working conditions"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The defeat at Leuven year 891."
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The discovery of the Golden Horns of Gallehus"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The equality law"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The establishment of the Progress Party"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The establishment of the region orchestra"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The financial crises"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The invention of the wheel"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The old Little Belt bridge"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The present"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The social inequalities"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The social law"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The storm"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When Venstre lost the power"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When the crown prince couple got married"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When the financial crisis was over"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"change of political system in 1901"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the Age of Enlightenment"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"the Marshall help"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the battle at Hastings, 1066"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the end of the last ice age"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the little mermaid"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the loss of Sk?ne, Halland og Blekinge"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"the rebelion i 1967-68"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"unemployment"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When we sold the oil to Norway without getting anything in return"




							
gen	traditional_future	=	.				
replace	traditional_future	=	0	if	futureEvent_groups	==	"No answer"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"A better welfare system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Employment opportunities"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Integration and tolerance"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Efficient public servers\service"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Out of EU"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better health care"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Greater equality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Peace"
replace	traditional_future	=	0	if	futureEvent_groups	==	"EU member"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Other"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Red majority"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Change the political system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Good education"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Blue majority"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Dealing with the Muslim problem"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Political change"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Cheaper cost of living"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Denmark for Danes"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Elimination of the welfare system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less relying on the welfare system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better Democracy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Dealing with terror"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Reducing poverty"
replace	traditional_future	=	0	if	futureEvent_groups	==	"That we stayed Danish"
replace	traditional_future	=	0	if	futureEvent_groups	==	"no war participation"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Back to traditional values"
replace	traditional_future	=	0	if	futureEvent_groups	==	"EU would work better"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Have a good image in the eyes of the world"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Royal family related issues"
replace	traditional_future	=	0	if	futureEvent_groups	==	"End racism"
replace	traditional_future	=	0	if	futureEvent_groups	==	"European football Championship"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Free cannabis"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Greater inequality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Many"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More resources for institutions"
replace	traditional_future	=	0	if	futureEvent_groups	==	"No dependence on oil from the Middle East"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Public transport becomes free"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Reconquest of Scania"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Same"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Tension from Russia"
replace	traditional_future	=	0	if	futureEvent_groups	==	"That Denmark would act more internationally"
replace	traditional_future	=	0	if	futureEvent_groups	==	"That the country again became more homogeneous"
replace	traditional_future	=	0	if	futureEvent_groups	==	"War"
replace	traditional_future	=	0	if	futureEvent_groups	==	"growth in peripheral Denmark"
replace	traditional_future	=	0	if	futureEvent_groups	==	"influx to large cities stops"
replace	traditional_future	=	0	if	futureEvent_groups	==	"privatization"
							
							
gen	survival_future	=	.				
replace	survival_future	=	0	if	futureEvent_groups	==	"No answer"
replace	survival_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	survival_future	=	1	if	futureEvent_groups	==	"A better welfare system"
replace	survival_future	=	1	if	futureEvent_groups	==	"Employment opportunities"
replace	survival_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	survival_future	=	1	if	futureEvent_groups	==	"Strong economy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Integration and tolerance"
replace	survival_future	=	0	if	futureEvent_groups	==	"Efficient public servers\service"
replace	survival_future	=	0	if	futureEvent_groups	==	"Out of EU"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better health care"
replace	survival_future	=	1	if	futureEvent_groups	==	"Tax reform"
replace	survival_future	=	0	if	futureEvent_groups	==	"Greater equality"
replace	survival_future	=	0	if	futureEvent_groups	==	"Peace"
replace	survival_future	=	0	if	futureEvent_groups	==	"EU member"
replace	survival_future	=	0	if	futureEvent_groups	==	"Other"
replace	survival_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	survival_future	=	0	if	futureEvent_groups	==	"Red majority"
replace	survival_future	=	0	if	futureEvent_groups	==	"Change the political system"
replace	survival_future	=	0	if	futureEvent_groups	==	"Good education"
replace	survival_future	=	0	if	futureEvent_groups	==	"Blue majority"
replace	survival_future	=	1	if	futureEvent_groups	==	"Dealing with the Muslim problem"
replace	survival_future	=	0	if	futureEvent_groups	==	"Political change"
replace	survival_future	=	1	if	futureEvent_groups	==	"Cheaper cost of living"
replace	survival_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	survival_future	=	0	if	futureEvent_groups	==	"Denmark for Danes"
replace	survival_future	=	1	if	futureEvent_groups	==	"Elimination of the welfare system"
replace	survival_future	=	1	if	futureEvent_groups	==	"Less crime"
replace	survival_future	=	1	if	futureEvent_groups	==	"Less relying on the welfare system"
replace	survival_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better Democracy"
replace	survival_future	=	1	if	futureEvent_groups	==	"Dealing with terror"
replace	survival_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	survival_future	=	1	if	futureEvent_groups	==	"Reducing poverty"
replace	survival_future	=	0	if	futureEvent_groups	==	"That we stayed Danish"
replace	survival_future	=	0	if	futureEvent_groups	==	"no war participation"
replace	survival_future	=	0	if	futureEvent_groups	==	"Back to traditional values"
replace	survival_future	=	0	if	futureEvent_groups	==	"EU would work better"
replace	survival_future	=	0	if	futureEvent_groups	==	"Have a good image in the eyes of the world"
replace	survival_future	=	0	if	futureEvent_groups	==	"Royal family related issues"
replace	survival_future	=	0	if	futureEvent_groups	==	"End racism"
replace	survival_future	=	0	if	futureEvent_groups	==	"European football Championship"
replace	survival_future	=	0	if	futureEvent_groups	==	"Free cannabis"
replace	survival_future	=	0	if	futureEvent_groups	==	"Greater inequality"
replace	survival_future	=	0	if	futureEvent_groups	==	"Many"
replace	survival_future	=	0	if	futureEvent_groups	==	"More resources for institutions"
replace	survival_future	=	1	if	futureEvent_groups	==	"No dependence on oil from the Middle East"
replace	survival_future	=	1	if	futureEvent_groups	==	"Poverty"
replace	survival_future	=	1	if	futureEvent_groups	==	"Public transport becomes free"
replace	survival_future	=	1	if	futureEvent_groups	==	"Reconquest of Scania"
replace	survival_future	=	0	if	futureEvent_groups	==	"Same"
replace	survival_future	=	1	if	futureEvent_groups	==	"Tension from Russia"
replace	survival_future	=	0	if	futureEvent_groups	==	"That Denmark would act more internationally"
replace	survival_future	=	0	if	futureEvent_groups	==	"That the country again became more homogeneous"
replace	survival_future	=	1	if	futureEvent_groups	==	"War"
replace	survival_future	=	0	if	futureEvent_groups	==	"growth in peripheral Denmark"
replace	survival_future	=	0	if	futureEvent_groups	==	"influx to large cities stops"
replace	survival_future	=	1	if	futureEvent_groups	==	"privatization"
							
							
gen	self_expression_future	=	.				
replace	self_expression_future	=	0	if	futureEvent_groups	==	"No answer"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"A better welfare system"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Employment opportunities"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Environmental Policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Integration and tolerance"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Efficient public servers\service"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Out of EU"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better health care"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Greater equality"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Peace"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"EU member"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Other"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Red majority"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Change the political system"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Good education"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Blue majority"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Dealing with the Muslim problem"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Political change"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Cheaper cost of living"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Denmark for Danes"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Elimination of the welfare system"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less relying on the welfare system"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Technological and scientific progress"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better Democracy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Dealing with terror"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Reducing poverty"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"That we stayed Danish"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"no war participation"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Back to traditional values"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"EU would work better"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Have a good image in the eyes of the world"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Royal family related issues"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"End racism"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"European football Championship"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Free cannabis"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Greater inequality"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Many"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More resources for institutions"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"No dependence on oil from the Middle East"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Public transport becomes free"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Reconquest of Scania"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Same"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Tension from Russia"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"That Denmark would act more internationally"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"That the country again became more homogeneous"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"War"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"growth in peripheral Denmark"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"influx to large cities stops"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"privatization"
							
							
gen	us_vs_them_future	=	.				
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"No answer"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Immigration policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"A better welfare system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Employment opportunities"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Integration and tolerance"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Efficient public servers\service"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Out of EU"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better health care"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Greater equality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Peace"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"EU member"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Other"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Red majority"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Change the political system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Good education"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Blue majority"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Dealing with the Muslim problem"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Political change"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Cheaper cost of living"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Denmark for Danes"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Elimination of the welfare system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less relying on the welfare system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better Democracy"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Dealing with terror"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Reducing poverty"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"That we stayed Danish"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"no war participation"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Back to traditional values"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"EU would work better"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Have a good image in the eyes of the world"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Royal family related issues"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"End racism"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"European football Championship"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Free cannabis"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Greater inequality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Many"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More resources for institutions"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"No dependence on oil from the Middle East"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Public transport becomes free"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Reconquest of Scania"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Same"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Tension from Russia"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"That Denmark would act more internationally"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"That the country again became more homogeneous"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"War"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"growth in peripheral Denmark"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"influx to large cities stops"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"privatization"
							
							
gen	us_and_them_future	=	.				
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"No answer"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"A better welfare system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Employment opportunities"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Integration and tolerance"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Efficient public servers\service"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Out of EU"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better health care"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Greater equality"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Peace"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"EU member"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Other"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Red majority"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Change the political system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Good education"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Blue majority"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Dealing with the Muslim problem"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Political change"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Cheaper cost of living"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Denmark for Danes"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Elimination of the welfare system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less relying on the welfare system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better Democracy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Dealing with terror"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Reducing poverty"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"That we stayed Danish"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"no war participation"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Back to traditional values"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"EU would work better"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Have a good image in the eyes of the world"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Royal family related issues"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End racism"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"European football Championship"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Free cannabis"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Greater inequality"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Many"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More resources for institutions"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"No dependence on oil from the Middle East"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Public transport becomes free"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Reconquest of Scania"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Same"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Tension from Russia"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"That Denmark would act more internationally"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"That the country again became more homogeneous"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"War"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"growth in peripheral Denmark"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"influx to large cities stops"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"privatization"


encode pastEvent_groups, generate(pastEvent_groups1)
encode futureEvent_groups, generate(futureEvent_groups1)

gen Storycalsification=.
replace Storycalsification=1 if survival_past==1 | survival_future==1
replace Storycalsification=2 if self_expression_past==1|self_expression_future==1
replace Storycalsification=3 if us_vs_them_past==1|us_vs_them_future==1

label define Storycalsification 1 "survival" 2 "Self-Expression" 3 "us/them", replace 
label values Storycalsification Storycalsification

mca   general_past general_future Storycalsification DN_votechoice if (general_past<20 & general_past!=17 & general_future<20) &(DN_votechoice==1 | DN_votechoice==6 |DN_votechoice==3 |DN_votechoice==7)  , dim(3) 
mcaplot, overlay xline(0) yline(0)  mlabpos(12) mlabgap(2) scale(.7) ///
mlabsize(vsmall)   
graph save "Fig 1c", replace

*combined past and future variables
gen traditional=traditional_past+traditional_future
gen survival=survival_past+survival_future
gen self_expression=self_expression_past+self_expression_future
gen us_vs_them=us_vs_them_past+us_vs_them_future
gen us_and_them=us_and_them_past+us_and_them_future

* Us and them scale
gen us_them_scale=.
replace us_them_scale=-2 if us_vs_them==2 & us_and_them==0
replace us_them_scale=-1 if us_vs_them==1 & us_and_them==0
replace us_them_scale=-1 if us_vs_them==2 & us_and_them==1
replace us_them_scale=1 if us_and_them==1 & us_vs_them==0
replace us_them_scale=1 if us_and_them==2 & us_vs_them==1
replace us_them_scale=2 if us_and_them==2 & us_vs_them==0
replace us_them_scale=0 if  us_vs_them==us_and_them
br us_vs_them  us_and_them  us_them_scale
tab us_them_scale
gen usvsthem=us_them_scale*-1

* Factor analysis of populist perceptions battery
recode statement1 (99=.)
recode statement2 (99=.)
recode statement3 (99=.)
recode statement4 (99=.)
recode statement5 (99=.)
recode statement6 (99=.)
recode statement7 (99=.)
recode statement8 (99=.)

tab1 statement1-statement8
factor statement1-statement8
revrs statement5-statement8
factor statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
alpha statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
gen populist_attitudes=(statement1+statement2+statement3+statement4+revstatement5+revstatement6+revstatement7+revstatement8)/8
tab populist_attitudes
ttest populist_attitudes, by(populist_vote_dn)

* Party-family variable
gen party_family = . 
replace party_family=1 if DN_votechoice==6
replace party_family=2 if DN_votechoice==3
replace party_family=2 if DN_votechoice==7
replace party_family=3 if DN_votechoice==1
replace party_family=3 if DN_votechoice==2
replace party_family=3 if DN_votechoice==4
replace party_family=3 if DN_votechoice==8
label define party_family1 1 "Populist" 2 "Mainstream Right" 3 "Mainstream Left"
label values party_family party_family1
tab party_family

set scheme plottig
/*labeling of variables for reg coef.*/
label var usvsthem "Us/them"
label var survival "Survival"
label var self_expression "Self-expression"
label var populist_attitudes "Populist attitudes"
label var gender "Female"
label var political_knowledge "Political knowledge"
label var political_interest "Political interest"
label var leftright "L-R ideology"
label var rural "Rural"
label var DN_education "Education"
label var DN_income "Income"
label var DN_social_class "Class"
label var DN_age "Age"
label var survival_past "Survival - past"
label var us_vs_them_future "Confrontational - future"
label var us_vs_them_past "Confrontational - past"
label var survival_future "Survival - future"
label var self_expression_future "Expressional - future"
label var self_expression_past "Expressional - past"


/*LOGIT*/

logit populist_vote_dn usvsthem survival self_expression populist_attitudes gender  political_interest political_knowledge leftright  rural DN_education  DN_social_class DN_age
est store m1
coefplot m1,  drop(_cons) xline(0) title("DK") levels(95) ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 
graph save "dk coef", replace

/*margins*/
margin, atmeans at(DN_education= (1 2 3 4 5))/*moving from vocational education to having a bachler degree decreases the probability to vote for populsit party by 8.5 percent. */
margin, atmeans at(usvsthem= (-2 -1 0 1 2)) /*moving from not having past and future boundary story to having both past and future boundary increases the probabilty to vote rr by 19 percent.*/

/*robustness - without populist attitudes*/
logit populist_vote_dn usvsthem survival self_expression  gender  political_interest political_knowledge leftright  rural DN_education  DN_social_class DN_age
est store m2
coefplot m2,  drop(_cons) xline(0) title("DK") levels(95) ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 


/*mlogit*/
mlogit party_family usvsthem survival self_expression populist_attitudes gender  political_interest political_knowledge leftright  rural DN_education  DN_social_class DN_age, base(2) 
est sto m3	
esttab  m3  using Table4.rtf ///
, cells(b(star fmt(2)) se(par fmt(2))) nogaps stat(pr2 N) ///
 title("Support for the radical right (Multinomal Model, DK)") 


/*diperssion of populist story components in society*/
statplot us_vs_them_future, over(party_family)  
catplot us_vs_them_future party_family , percent(party_family) stack asyvars title("DK")
graph save "usthem_DK", replace

logit populist_vote_dn c.usvsthem##c. DN_education  survival self_expression populist_attitudes gender  political_interest leftright  rural DN_social_class DN_age
margin, atmeans at(usvsthem=(-2  -1 0 1 2) DN_education=(0 1 2 3 4 5)) /* 8% probability to vote rr for individulas with lowe levels of education and who have past and future confrontational story*/
marginsplot
est sto educ_dk	

interflex populist_vote_dn  usvsthem DN_education revDN_social_class DN_education survival self_expression  survival self_expression gender  political_interest leftright  rural DN_education  DN_social_class DN_age,  type(kernel)  ///
dlabel("Us/them") xlabel("Education") title("DK") 

logit populist_vote_dn c.usvsthem##c.revDN_social_class  survival self_expression DN_education populist_attitudes gender  political_interest leftright  rural  DN_age    
margin, atmeans at(usvsthem=(-2  -1 0 1 2) revDN_social_class=(1 2 3 4)) /* 8% probability to vote rr for individulas with lowe levels of education and who have past and future confrontational story*/
marginsplot
est sto class_dk	

interflex populist_vote_dn  usvsthem revDN_social_class DN_education survival self_expression  survival self_expression gender  political_interest leftright  rural DN_education  DN_social_class DN_age,  type(kernel)  ///
dlabel("Us/them") xlabel("Social class") title("DK") 
graph save "social class_dk"

log close